<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/fmt" prefix="fmt" %>
<%@ taglib uri="http://www.springframework.org/tags/form" prefix="form" %>
<%@ include file="../general/header.jsp" %>

<script type="text/javascript">
	function copyToClipboard() {
		window.prompt("Apriete Ctrl+C y luego Enter: ", "${emails}");
	}
</script>

	<h3>Perfil de b&uacute;squeda: <c:out value="${results.name}" /></h3>
	<form:form method="POST" action="../data/SaveActions" commandName="massiveSaveForm" >
		<div class="menuacciones">
			<c:if test="${!empty results.results}">
				<input class="boton" type="submit" value="Exportar" name="export" />
				<input class="boton" type="button" value="Copiar todos los e-mails" onclick="copyToClipboard()" />
				<input class="boton color" type="submit" value="Borrar del perfil" name="delete" />
			</c:if>
			<a class="boton volver color" href="../data/ListSavedResults">Volver</a>
		</div>
		<div class="featurebox_center" id="search">
			<c:choose>
				<c:when test="${empty results.results}">
					<h2>No hay usuarios en el perfil de b&uacute;squeda seleccionado.</h2>
				</c:when>
				<c:otherwise>
					<input type="hidden" name="profileId" value="${results.id}" />
					<div class="seleccionar">
						<a href="#" onclick="selectAll(); return false;">Seleccionar todos</a>&nbsp;&nbsp;&nbsp;&nbsp;
						<a href="#" onclick="unselectAll(); return false;">Deseleccionar todos</a>
					</div>
					<div class="clear"></div>
					<ul class="usuarios">
						<c:forEach var="result" items="${results.results}">
							<c:set var="user" value="${result.user}"/>
							<div style="position:relative; float:left">
								<c:set var="link" value="../user/viewResult?resultId=${result.id}&searchResultId=${results.id}" />
								<c:set var="showCheckBox" value="true" />
								<c:set var="linkText" value="Ver Perfil"/>
								<%@ include file="../user/user.jsp" %>
								<div class="clear"></div>
								<div onclick='javascript: flagResult(${result.id},${result.flagged},${results.id}); return false;' class="star star${result.flagged}" id="star${result.id}" ></div>
							</div>
						</c:forEach>
						<div class="clear"></div>
					</ul>
				
				</c:otherwise>
			</c:choose>
		</div>
	</form:form>
<%@ include file="../general/footer.jsp" %>

